

let v = new Vue({
    el:"#downloadBody",
    data () {
        return{
            items:[

            ],
            instlist:[],
            artId:null
        }
    },
    created:function (){
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if(pair[0] === "id"){
                this.artId = pair[1]
            }
        }

        axios.post("/back/instjc",this.items).then(function (response){
            v.instlist = response.data
        })
    },
    methods: {
        updownload(){
            axios.post("/back/artautinst/"+this.artId,this.items).then(function (response){
                this.items = []
                if (response.data === 'ok'){
                    v.$Message.success({
                        content: "链接成功！祝贺",
                        duration: 5
                    });
                }else {
                    v.$Message.error({
                        content: "服务器娘发生错误(っ °Д °;)っ",
                        duration: 5
                    });
                }
            })
        },

    }
})


let z = new Vue({
    el:"#hander-finx",
    data:{
        i:null
    },
    methods: {
        loginout(){
            axios.post("/loginout").then(function (response){
                z.$Message.success({
                    content: "退出成功！（；´д｀）ゞ",
                    duration: 3
                });
                this.i = setTimeout(()=>{
                    //需要延迟的代码 :3秒后延迟跳转到首页，可以加提示什么的
                    window.location.href = "/login"
                    //延迟时间：3秒
                },3000)
            })
        }
    },
    beforeDestroy(){
        clearTimeout(this.i)
    }
})

let year = document.getElementById("newyear")
year.innerText = ""+new Date().getFullYear()+""